home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / batmn21e.zip / BATMAN.DOC next >
Text File  |  1990-12-01  |  25KB  |  837 lines

  1.  
  2.     │
  3.     │ B A T M A N   2 . 1 e
  4.     │
  5.     │ - a batch file
  6.     │   compiler
  7.     │
  8.     │ Thor Ivar Ekle 1989, 90
  9.     │
  10.  
  11.  
  12.  
  13.  
  14.     WHAT IS BATMAN?
  15.     ───────────────
  16.  
  17.     Batman is a utility for compiling batch files, or, in other words,
  18.     translating .BAT-files into .EXE-files. There are two reasons why you
  19.     might to bother with this; first, .EXE-files usually execute much
  20.     faster than .BAT-files. Secondly, batch files are normal text files,
  21.     which means that they can be printed on a screen or printer, whereas
  22.     .EXE-files are unreadable to anyone but a PC. Besides, Batman adds a
  23.     lot of functionality which the DOS batch language lacks.
  24.  
  25.     This version of Batman is free. You may make as many copies as you
  26.     like, and please feel free to give away copies of the program. You may
  27.     not, however, sell part or whole of this package. All distribution of
  28.     Batman is to done by means of the file BATMN21E.ZIP, which shall
  29.     contain these files:
  30.  
  31.         BATMAN.EXE   - the compiler.
  32.         ROBIN.DAT    - data file used by Batman.
  33.         BATMAN.DOC   - this file.
  34.         BATNEWS.TXT  - summary of the latest news in Batman.
  35.         TRACY.EXE    - interactive debugger.
  36.         TRACY.DOC    - documentation for Tracy.
  37.         COLORS.EXE   - utility which displays the available color codes.
  38.         EXCOM.EXE    - utility which reports how external commands are
  39.                        executed.
  40.         GCD.EXE      - utility which displays the directory tree and lets
  41.                        you change the current directory.
  42.         MEXEC.EXE    - utility which lets you select files and pass them as
  43.                        arguments to a specified command.
  44.  
  45.     Should you have any questions regarding Batman, please feel free to
  46.     call me at +47-7-518621.
  47.  
  48.  
  49.  
  50.     USING BATMAN
  51.     ────────────
  52.  
  53.     The command for starting Batman is:
  54.  
  55.         BATMAN [/A] [/C] [/D] <batch file>
  56.  
  57.     The parameter <batch file> is the name of the .BAT-file you wish to
  58.     compile.
  59.  
  60.     Options:
  61.  
  62.         /A:  If there already exists a file by the same name as the
  63.              batch file with the extension .EXE, Batman will normally ask
  64.              you to confirm that it should be replaced before compilation
  65.              starts. Also, the message "Done - press <─┘" is displayed
  66.              after Batman has completed a successful compilation. These two
  67.              messages are omitted if this option is selected. This is
  68.              useful for automatic compilations.
  69.  
  70.         /C:  This option forces Batman to always use COMMAND.COM for
  71.              execution of external commands. See the section "External
  72.              Commands" for more information.
  73.  
  74.         /D:  Use this option if you wish to debug the program file with
  75.              the interactive debugger Tracy. See the documentation for
  76.              Tracy for more information.
  77.  
  78.     You may include a full path in <batch file> if the desired file isn't
  79.     located in the current directory. You may omit the extension ".BAT",
  80.     but other extensions are not accepted. Batman will search for the
  81.     requested file, and display an error message if it can't be found.
  82.  
  83.     If found, a new file with the same name, but with the extension ".EXE"
  84.     will be created. If such a file already exists, you will be asked to
  85.     confirm that it should be overwritten and replaced by the new file. The
  86.     resulting .EXE-file will be stored in the same directory as the
  87.     batch file.
  88.  
  89.     During compilation, the file ROBIN.DAT must be available. This file is
  90.     not required by the compiled program file.
  91.  
  92.     The batch file may contain most DOS commands, plus, of course, Batman's
  93.     internal commands. The internal commands are:
  94.  
  95.  
  96.     BELL
  97.     ────
  98.  
  99.     Produces a beep. Useful for alerting the user when a time-consuming
  100.     task has completed.
  101.  
  102.  
  103.     CALL
  104.     ────
  105.  
  106.     This command is used to execute other compiled batch files. The format
  107.     is:
  108.  
  109.         CALL <filename>
  110.  
  111.     When you compile a batch file which contains CALL-commands, Batman will
  112.     display a list of the referenced batch files after compilation has
  113.     completed. This is to remind you to compile these files as well before
  114.     trying to run the program file.
  115.  
  116.     The procedure for calling uncompiled batch files is described in a
  117.     later section.
  118.  
  119.  
  120.     CLOCK
  121.     ─────
  122.  
  123.     Displays a clock on the screen. Formats:
  124.  
  125.         CLOCK ON <column> <line> <foreground color> <background color>
  126.         CLOCK OFF
  127.  
  128.     The form CLOCK ON displays the current time on the screen in the
  129.     desired location and in the chosen colors. CLOCK OFF stops the clock,
  130.     but does not remove the last displayed time.
  131.  
  132.  
  133.     CLREOL
  134.     ──────
  135.  
  136.     Blanks the current line, starting with the cursor position.
  137.  
  138.  
  139.     CLS
  140.     ───
  141.  
  142.     Blanks the whole screen.
  143.  
  144.  
  145.     COLOR
  146.     ─────
  147.  
  148.     Select the colors in which text is displayed on the screen. Parameters
  149.     are foreground and background colors. The format is:
  150.  
  151.         COLOR <foreground color> <background color>
  152.  
  153.     An example:
  154.  
  155.         color 15 1
  156.  
  157.     This will result in white text on a blue background. These are the valid
  158.     color codes:
  159.  
  160.          0 = Black
  161.          1 = Blue
  162.          2 = Green
  163.          3 = Cyan
  164.          4 = Red
  165.          5 = Magenta
  166.          6 = Brown
  167.          7 = Light gray
  168.          8 = Dark gray
  169.          9 = Light blue
  170.         10 = Light green
  171.         11 = Light cyan
  172.         12 = Light red
  173.         13 = Light magenta
  174.         14 = Yellow
  175.         15 = White
  176.  
  177.     Note that you can only use the colors 0-7 for background colors. In
  178.     order for the COLOR command to work, you must load ANSI.SYS or a
  179.     compatible screen driver.
  180.  
  181.     Use the included utility COLORS to see how the different color codes
  182.     look on your screen.
  183.  
  184.  
  185.     DATESTR
  186.     ───────
  187.  
  188.     Displays the current date on the screen. The format is:
  189.  
  190.         DATESTR <column> <line>
  191.  
  192.     The date is displayed in the format DD.MM.YY, and in the current color.
  193.  
  194.  
  195.     DELAY
  196.     ─────
  197.  
  198.     Pauses the execution of the program for the specified number of
  199.     seconds. The format is:
  200.  
  201.         DELAY <seconds>
  202.  
  203.     This command, for example, will result in a 5-second pause:
  204.  
  205.         delay 5
  206.  
  207.     The parameter can be in the range 0 to 60 seconds.
  208.  
  209.  
  210.     ECHO
  211.     ────
  212.  
  213.     Displays a text string on the screen. Format:
  214.  
  215.         ECHO <text>
  216.  
  217.     The forms ECHO [ON | OFF] are not supported, as Batman never echoes any
  218.     commands anyway.
  219.  
  220.     A blank line can be displayed by echoing just a period:
  221.  
  222.         echo .
  223.  
  224.     This is a common method for displaying blank lines, and is implemented
  225.     is several DOS versions.
  226.  
  227.  
  228.     FOR
  229.     ───
  230.  
  231.     Constructs a loop which allows you to repeat a command for selected
  232.     files. The format is:
  233.  
  234.         FOR <variable> IN (<file specification>) DO <command>
  235.  
  236.     An example:
  237.  
  238.         for %%x in (*.txt) do copy %%x lpt1:
  239.  
  240.     This command will print all files with the extension ".TXT" on the
  241.     printer.
  242.  
  243.  
  244.     GOTO / GOSUB / RETURN
  245.     ─────────────────────
  246.  
  247.     These commands allow you to transfer control to another place in the
  248.     batch file. Formats:
  249.  
  250.         GOTO <label>
  251.         GOSUB <label>
  252.  
  253.     Such jumps can only be made to lines that contain a "label". This is a
  254.     line which starts with a colon, for example:
  255.  
  256.         :label1
  257.  
  258.     Batman distinguishes only between the first 8 characters i label names.
  259.  
  260.     If the jump is made by means of the GOSUB command, you can return to
  261.     the following line with the RETURN command. This is not the case when
  262.     control is transferred with the GOTO command.
  263.  
  264.     GOSUB commands may be nested:
  265.  
  266.         :start
  267.      ┌─ gosub label_1
  268.      │  return        <─┐
  269.      └> :label_1        │
  270.      ┌─ gosub label_2   │
  271.      │  echo Label 1  <┐│
  272.      │  return        ─│┘
  273.      └> :label_2       │
  274.         echo Label 2   │
  275.         return        ─┘
  276.  
  277.     You can nest GOSUB commands in 64 levels.
  278.  
  279.  
  280.     IF
  281.     ──
  282.  
  283.     Logical condition.